package com.qf.edu.service.impl;

import com.qf.edu.dao.PassWord;
import com.qf.edu.dao.impl.PassWordImpl;
import com.qf.edu.entity.Users;
import com.qf.edu.service.PassWordService;

import java.util.List;

/**
 * @author:huayuzhuo
 * @email:2798866329@qq.com
 * @desc:
 * @datatime: 2022/5/26 17:18
 */
public class PassWordServiceImpl implements PassWordService {
    @Override
    public String passWoSer(Users users, String name,String password) {
        PassWord passWord = new PassWordImpl();
        List<Users> userk = passWord.userk(name,password);
        if (userk != null){
            int i = passWord.uPassW(users, name,password);
            if (i == 1){
                return "修改密码通过";
            } else {
                return "修改密码失败";
            }
        } else {
            return "原密码错误，请重新输入";
        }
    }
}
